package com.tanhua.app.service;

import com.tanhua.app.interceptor.UserHolder;
import com.tanhua.dubbo.api.UserLocationApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {

    @DubboReference
    private UserLocationApi userLocationApi;


    //上传地理位置
    public void location(Double latitude, Double longitude, String addrStr) {
        Boolean isUpdate = userLocationApi.updateLocation(UserHolder.getUserId(),latitude,longitude,addrStr);
        if (!isUpdate){
            throw new RuntimeException("上传用户地址信息失败");
        }
    }
}
